﻿//通用模板JS
$(function () {
    var fn = ABUS.Fn;

    $(".click_login").on("touchend", function () {
        var username = $("[name=username]").val();
        var password = $("[name=password]").val();
        if(username && password){
            fn.get({
                url:"/common/login",
                data:{
                    loginName:$("[name=username]").val(),
                    password:$("[name=password]").val()
                },
                success:function (data) {
                    if(data.result === 1){
                        fn.page_goto({
                            url:"../../login.html"
                        })
                    }else{
                        fn.alert({
                            type:"error",
                            title:"用户名或密码错误"
                        })
                    }
                }
            });
        }else{
            fn.alert({
                type:"error",
                title:"请输入用户名和密码"
            })
        }

    })
});